package zhu.areas.match.dao;

import java.util.List;

import zhu.areas.match.data.Sponsor;
import zhu.common.dao.BaseDAOImpl;

public class SponsorDAOImpl extends BaseDAOImpl implements ISponsorDAO {
	

	public void saveSponsor(Sponsor sponsor) {		
		super.saveOrUpdate(sponsor);
	}

	public Sponsor findSponsorById(int id) {
		
		return (Sponsor) super.findById(Sponsor.class, id);
	}

	public List<Sponsor> findAllSponsor() {
		
		return (List<Sponsor>)super.find("from Sponsor");
	}

	public List<Sponsor> findSponsorByCompId(int compID) {		
		return super.find("from Sponsor where Sponsor.compApp.compID="+compID);
	}
}
